﻿@using (Ajax.BeginForm("CreateNewEnum", null, new AjaxOptions
{
    HttpMethod = "POST",
    OnSuccess = "successCreate",
    OnFailure = "errorCreate"
}, new { id = "createForm" }))
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Create enum items</legend>

        <div class="editor-label">
            @Html.Label("Enum name")
        </div>
        <div class="editor-field">
            @Html.TextBox("enumName","", new { data_bind = "value:EnumName" })
        </div>
        <div class="enmuItemsHolder">
            <label>Add enum items</label>
            <div>
                @Html.TextBox("enumItem", "", new { data_bind = "value:ItemName" })
                <button type="button" id="addItem" data-bind="click:addItemToList"><i class="icon-btn icon-plus"></i></button>
            </div>
            <ul class="itemsHolder" data-bind="foreach: EnumItems">
                <li><span class="itemName"data-bind="text:$data">Name</span><span class="delteEnumItem" data-bind="click:$parent.removeItem"><i class="icon-btn icon-trash"></i></span></li>
            </ul>
        </div>
        <button data-bind="click:saveData" id="generate">Generate items to translate</button>
    </fieldset>
}